package com.canaan.business.common.enums.productBom;

import com.canaan.common.utils.StringUtils;

/**
 * 物料BOM状态枚举
 */
public enum BomStatusEnum {

    /*
    正常
     */
    NORMAL("NORMAL", "正常"),
    /*
    报废
     */
    SCRAP("SCRAP", "报废");

    private final String code;
    private final String message;

    BomStatusEnum(String code, String info)
    {
        this.code = code;
        this.message = info;
    }

    public String getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(String code){
        for(BomStatusEnum inspectionStatusEnum: BomStatusEnum.values()){
            if(StringUtils.isEmpty(code)){
                return null;
            }
            if(code.equals(inspectionStatusEnum.code)){
                return inspectionStatusEnum.message;
            }
        }
        return null;
    }
}
